package org.lemon.transport.context.data.device;

/**
 * 转移至api层
 */
public interface MqttTopics {

    // v1 gateway topics
    String BASE_GATEWAY_API_TOPIC = "v1/gateway";
    String GATEWAY_CONNECT_TOPIC = "v1/gateway/connect";
    String GATEWAY_DISCONNECT_TOPIC = "v1/gateway/disconnect";
    String GATEWAY_ATTRIBUTES_TOPIC = "v1/gateway/attributes";
    String GATEWAY_TELEMETRY_TOPIC = "v1/gateway/telemetry";
    String GATEWAY_CLAIM_TOPIC = "v1/gateway/claim";
    String GATEWAY_RPC_TOPIC = "v1/gateway/rpc";
    String GATEWAY_ATTRIBUTES_REQUEST_TOPIC = "v1/gateway/attributes/request";
    String GATEWAY_ATTRIBUTES_RESPONSE_TOPIC = "v1/gateway/attributes/response";

    // v1 topics
    String DEVICE_RPC_REQUESTS_TOPIC = "v1/devices/me/rpc/request/";
    String DEVICE_RPC_REQUESTS_SUB_TOPIC = "v1/devices/me/rpc/request/+";

    String DEVICE_RPC_RESPONSE_TOPIC = "v1/devices/me/rpc/response/";
    String DEVICE_RPC_RESPONSE_SUB_TOPIC = "v1/devices/me/rpc/response/+";

    String DEVICE_ATTRIBUTES_RESPONSE_TOPIC_PREFIX = "v1/devices/me/attributes/response/";
    String DEVICE_ATTRIBUTES_RESPONSES_TOPIC = "v1/devices/me/attributes/response/+";
    String DEVICE_ATTRIBUTES_REQUEST_TOPIC_PREFIX = "v1/devices/me/attributes/request/";

    String DEVICE_TELEMETRY_TOPIC = "v1/devices/me/telemetry";
    String DEVICE_CLAIM_TOPIC = "v1/devices/me/claim";
    String DEVICE_ATTRIBUTES_TOPIC = "v1/devices/me/attributes";
    String DEVICE_PROVISION_REQUEST_TOPIC = "/provision/request";
    String DEVICE_PROVISION_RESPONSE_TOPIC = "/provision/response";

    // v2 topics
    String DEVICE_SOFTWARE_FIRMWARE_RESPONSES_TOPIC_FORMAT = "v2/%s/response/%s/chunk/%d";

    String DEVICE_FIRMWARE_REQUEST_TOPIC_PATTERN = "v2/firmware/request/(?<requestId>\\d+)/chunk/(?<chunk>\\d+)";
    String DEVICE_FIRMWARE_RESPONSES_TOPIC = "v2/firmware/response/+/chunk/%d";
    String DEVICE_FIRMWARE_ERROR_TOPIC = "v2/firmware/error";

    String DEVICE_SOFTWARE_REQUEST_TOPIC_PATTERN = "v2/software/request/(?<requestId>\\d+)/chunk/(?<chunk>\\d+)";
    String DEVICE_SOFTWARE_RESPONSES_TOPIC = "v2/software/response/+/chunk/%d";
    String DEVICE_SOFTWARE_ERROR_TOPIC = "v2/software/error";

    String DEVICE_ATTRIBUTES_SHORT_TOPIC = "v2/att";
    String DEVICE_ATTRIBUTES_SHORT_JSON_TOPIC = "v2/att/json/";
    String DEVICE_ATTRIBUTES_SHORT_PROTO_TOPIC = "v2/att/proto/";

    String DEVICE_TELEMETRY_SHORT_TOPIC = "v2/tem";
    String DEVICE_TELEMETRY_SHORT_JSON_TOPIC = "v2/tem/json/";
    String DEVICE_TELEMETRY_SHORT_PROTO_TOPIC = "v2/tem/proto/";

    String DEVICE_RPC_RESPONSE_SHORT_TOPIC = "v2/rpc/res/";
    String DEVICE_RPC_RESPONSE_SHORT_JSON_TOPIC = "v2/rpc/res/json/";
    String DEVICE_RPC_RESPONSE_SHORT_PROTO_TOPIC = "v2/rpc/res/proto/";

    String DEVICE_RPC_RESPONSE_SUB_SHORT_TOPIC = "v2/rpc/res/+";
    String DEVICE_RPC_RESPONSE_SUB_SHORT_JSON_TOPIC = "v2/rpc/res/json/+";
    String DEVICE_RPC_RESPONSE_SUB_SHORT_PROTO_TOPIC = "v2/rpc/res/proto/+";

    String DEVICE_RPC_REQUESTS_SHORT_TOPIC = "v2/rpc/req/";
    String DEVICE_RPC_REQUESTS_SHORT_JSON_TOPIC = "v2/rpc/req/json/";
    String DEVICE_RPC_REQUESTS_SHORT_PROTO_TOPIC = "v2/rpc/req/proto/";

    String DEVICE_RPC_REQUESTS_SUB_SHORT_TOPIC = "v2/rpc/req/+";
    String DEVICE_RPC_REQUESTS_SUB_SHORT_JSON_TOPIC = "v2/rpc/req/json/+";
    String DEVICE_RPC_REQUESTS_SUB_SHORT_PROTO_TOPIC = "v2/rpc/req/proto/+";

    String DEVICE_ATTRIBUTES_RESPONSE_SHORT_TOPIC_PREFIX = "v2/att/res/";
    String DEVICE_ATTRIBUTES_RESPONSES_SHORT_TOPIC = "v2/att/res/+";
    String DEVICE_ATTRIBUTES_RESPONSE_SHORT_JSON_TOPIC_PREFIX = "v2/att/res/json/";
    String DEVICE_ATTRIBUTES_RESPONSES_SHORT_JSON_TOPIC = "v2/a/res/json/+";
    String DEVICE_ATTRIBUTES_RESPONSE_SHORT_PROTO_TOPIC_PREFIX = "v2/att/res/proto/";
    String DEVICE_ATTRIBUTES_RESPONSES_SHORT_PROTO_TOPIC = "v2/att/res/proto/+";

    String DEVICE_ATTRIBUTES_REQUEST_SHORT_TOPIC_PREFIX = "v2/att/req/";
    String DEVICE_ATTRIBUTES_REQUEST_SHORT_JSON_TOPIC_PREFIX = "v2/att/req/json/";
    String DEVICE_ATTRIBUTES_REQUEST_SHORT_PROTO_TOPIC_PREFIX = "v2/att/req/proto/";
}
